<template>
  <div class="subject-detail">
    <div class="layout">
      <div class="page-title">
        <span>受试者招募详情：</span>
        <span @click="$emit('goBack')">返回</span>
      </div>
    </div>
    <div
      class="subject-detail-main"
      v-for="item in subjectDetailList"
      :key="item.BT"
    >
      <div>
        <h2 class="subject-main-content-title">
          {{item.BT}}
        </h2>
      </div>
      <div>
        <h4>项目描述：</h4>
        <div class="subject-main-content">
          {{item.XMMS}}
        </div>
      </div>
      <div>
        <h4>入选标准：</h4>
        <div class="subject-main-content">
          {{item.RXBZ}}
        </div>
      </div>
      <div>
        <h4>排除标准：</h4>
        <div class="subject-main-content">
          {{item.PCBZ}}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getSubjectDetailAPI } from '@/api/index.js';
export default {
    props: {
        id: {
            type: String,
            default: null
        }
    },
    data() {
        return {
            subjectDetailList: [],
            ip: ''
        };
    },
    mounted() {
        this.ready();
        // this.subjectData();
        this.getSubjectDetailData();
    },
    methods: {
        // 获取ip
        ready() {
            let cip = returnCitySN['cip'];
            let cid = returnCitySN['cid'];
            let cname = returnCitySN['cname'];
            this.ip = cip;
        },
        async getSubjectDetailData() {
            const res = await getSubjectDetailAPI({
                ip: this.ip,
                wyid: this.id
            });
            if (res.code == 'succ') {
                this.subjectDetailList = res.result;
            }
        }
    }
};
</script>
<style scoped>
.subject-detail {
    width: 100%;
    min-height: 100vh;
}
.subject-detail-main {
    width: 90%;
    margin: 0 auto;
    margin-top: 20px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 15px;
}
.subject-main-content-title {
    text-align: center;
}
.subject-main-content {
    display: flex;
    align-items: center;
    line-height: 40px;
    font-size: 1.3rem;
    text-indent: 2rem;
}
</style>